<?php
class App_Controller_Plugin_Admin extends Zend_Controller_Plugin_Abstract {
	public function preDispatch(Zend_Controller_Request_Abstract $request) {
		if ($request->getModuleName() != 'admin') {
			Zend_Layout::getMvcInstance()->disableLayout();
			return;
		}

		$frontController = Zend_Controller_Front::getInstance();  
		$moduleDirectory = $frontController->getModuleDirectory();
		$layoutPath = $moduleDirectory . '/views/layouts/';

		Zend_Layout::getMvcInstance()->setLayoutPath($layoutPath)->setLayout('admin');  
	}
}
